module Codewars.ThinkingAndTesting02 where

import Data.Char (ord, chr)

testit :: String -> String
testit (x:y:xs) = testit2 x y : testit xs
testit x = x

testit2 :: Char -> Char -> Char
testit2 x y = chr $ div ( ord x + ord y ) 2

-- after solution ord=fromEnum chr=toEnum

testit3 :: String -> String
testit3 (x:y:xs) = chr (div (ord x + ord y) 2 ) : testit3 xs
testit3 x = x
